package com.ryskoo.common.hclconstant;

/**
 * 优惠券明细状态
 * @author BeHappy
 */
public enum CouponStateEnum {
    UNUSED(1, "未使用"),
    USED(2, "已使用"),
    OUT_OF_DATE(3, "已过期");
    private int value;
    private String name;

    CouponStateEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByValue(int value) {
        for (CouponStateEnum o : CouponStateEnum.values()) {
            if (o.getValue() == value) {
                return o.getName();
            }
        }
        return "";
    }
}
